package com.siecomzg.packageinterface;

//import org.apache.cordova.CallbackContext;


/**
 * @author ronghua.yang
 * 外设统一接口
 */
public interface ExternalDeviceEngine {
	public static final String ACTION_READ_FINGER_PRINTER = "readFingerPrinter";
	public static final String ACTION_READ_ICCARD = "readIcCard";
	public static final String ACTION_READ_MSRCARD = "readMsrCard";
	public static final String ACTION_READ_PICCARD = "readPicCard";
	public static final String ACTION_READ_AUTO = "readCardAuto";
	public static final String ACTION_READ_CARD = "readCard";
	public static final String ACTION_READ_IDCARD = "readIdCard";
	public static final String ACTION_SET_ARPC = "writeARPCCard"; // ARPC 写卡操作
	public static final String ACTION_SET_ARPCCHECK = "checkARPC"; // ARPC校验
	public static final String ACTION_INPUT_MAINKEY = "inputMainKey";
	public static final String ACTION_INPUT_WORKKEY = "inputWorkKey";
	public static final String ACTION_UPDATE_KEY = "updateKey"; // 更新主密钥
	public static final String ACTION_READ_DEVICENUM = "readDeviceNum"; // 读取设备编号
	public static final String ACTION_WRITE_DEVICENUM = "writeDeviceNum"; // 写入设备编号
	public static final String ACTION_CANCELLAST_TASK = "cancelLastTask"; // 取消当前操作
	public static final String ACTION_STRAT_INPUT = "inputPassword";

	/**
	 * 读取卡片信息
	 * 
	 * @param cardType
	 *            读取类型
	 * @param outTime
	 *            超时时间设置
	 * @param isDownCard
	 *            是否下电 
	 */
	void readCard(int cardType, int outTime, String isDownCard, CallbackContext callbackContext);

	/**
	 * 读取身份证信息
	 * 
	 * @param outTime
	 *            超时时间设置
	 */
	void readIdCard(int outTime, CallbackContext callbackContext);

	/**
	 * IC卡写卡
	 * 
	 * @param ARPC
	 *            服务器传送的ARPC
	 * @param ScriptStr
	 *            服务器传送的执行脚本
	 * @param callbackContext
	 */
	void writeARPCCard(String ARPC, String ScriptStr,
                       CallbackContext callbackContext);

	/**
	 * IC卡校验
	 * 
	 * @param ARPC
	 *            服务器传送的ARPC
	 * @param callbackContext
	 */
	void checkARPC(String ARPC, CallbackContext callbackContext);

	/**
	 * 更新密钥
	 * 
	 * @param mainkey
	 *            密钥校验值
	 * @param pinValue
	 *            主密钥密文
	 * @param callbackContext
	 */
	void updateMainKey(String mainkey, String pinValue,
                       CallbackContext callbackContext);

	/**
	 * 读取设备编号
	 * 
	 * @param callbackContext
	 */
	void readDeviceNum(CallbackContext callbackContext);

	/**
	 * 写入设备编号
	 * 
	 * @param deviceNum
	 *            设备名称
	 * @param callbackContext
	 */
	void writeDeviceNum(String deviceNum, CallbackContext callbackContext);

	/**
	 * 取消当前操作
	 */
	void cancelOperation();

	/**
	 * 读取指纹特征码
	 * 
	 * @param autoType 
	 * @param outTime 超时时间设置
	 * @return
	 */
	void readFingerprint(int autoType, int outTime,
                         CallbackContext callbackContext);

	/**灌入主密钥
	 * 
	 * @param ComponentsOne 分量一
	 * @param ComponentsTwo 分量二
	 * @param callbackContext
	 */
	void inputMainKey(String ComponentsOne, String ComponentsTwo, String devnum,
                      CallbackContext callbackContext);

	/**灌入工作密钥
	 * 
	 * @param workKeyOne 第一个工作密钥
	 * @param workKeyTwo 第二个工作密钥
	 * @param callbackContext
	 */
	void inputWorkKey(String workKeyOne, String workKeyTwo,
                      CallbackContext callbackContext);

	/**启动密码键盘
	 * 
	 * @param cardNo 卡号 不能为空
	 * @param outTime 超时时间设置
	 * @param selectType 选择工作密钥类型
	 * @param callbackContext
	 */
	void inputPassWord(String cardNo, int outTime, int selectType,
                       CallbackContext callbackContext);
	/**
	 * 动态图匹配路径
	 * @param type 图片类型
	 * @param num 读卡时类型
	 * @return
	 */
	String getAnimationPath(String type, int num);
	/**
	 * 关闭动画dialog
	 */
    void closeDialog();
}
